<?php
namespace App\Console\Commands\Make;

use Symfony\Component\Console\Attribute\AsCommand;
use Jammiest\SwigeCore\Console\Commands\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
use Symfony\Component\Console\Input\InputArgument;

#[AsCommand(name: 'make:middleware', description: '创建新中间件')]
class MiddlewareCommand extends Command
{

    protected function configure()
    {
        // 可以在这里进一步配置命令
        $this->addArgument('name', InputArgument::REQUIRED, '中间件名称');
    }

    protected function execute(InputInterface $input, OutputInterface $output): int
    {
        $io = new SymfonyStyle($input, $output);
        
        try {

            return Command::SUCCESS;
            
        } catch (\Exception $e) {
            $io->error('备份失败: ' . $e->getMessage());
            return Command::FAILURE;
        }
    }
    
}